<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="module-exceptions.html" />
<link rel="prev" href="built-in-funcs.html" />
<link rel="parent" href="builtin.html" />
<link rel="next" href="module-exceptions.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>2.2 Non-essential Built-in Functions </title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.1 built-in Functions"
  href="built-in-funcs.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="2. built-in Objects"
  href="builtin.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="2.3 built-in Exceptions"
  href="module-exceptions.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="built-in-funcs.html">2.1 Built-in Functions</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="builtin.html">2. Built-in Objects</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-exceptions.html">2.3 Built-in Exceptions</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h1><a name="SECTION004200000000000000000"></a><a name="non-essential-built-in-funcs"></a>
<br>
2.2 Non-essential Built-in Functions 
</h1>

<p>
There are several built-in functions that are no longer essential to learn,
know or use in modern Python programming.  They have been kept here to
maintain backwards compatibility with programs written for older versions
of Python.

<p>
Python programmers, trainers, students and bookwriters should feel free to
bypass these functions without concerns about missing something important.

<p>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-87' xml:id='l2h-87' class="function">apply</tt></b>(</nobr></td>
  <td><var>function, args</var><big>[</big><var>, keywords</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
  The <var>function</var> argument must be a callable object (a
  user-defined or built-in function or method, or a class object) and
  the <var>args</var> argument must be a sequence.  The <var>function</var> is
  called with <var>args</var> as the argument list; the number of arguments
  is the length of the tuple.
  If the optional <var>keywords</var> argument is present, it must be a
  dictionary whose keys are strings.  It specifies keyword arguments
  to be added to the end of the argument list.
  Calling <tt class="function">apply()</tt> is different from just calling
  <code><var>function</var>(<var>args</var>)</code>, since in that case there is always
  exactly one argument.  The use of <tt class="function">apply()</tt> is equivalent
  to <code><var>function</var>(*<var>args</var>, **<var>keywords</var>)</code>.
  Use of <tt class="function">apply()</tt> is not necessary since the ``extended call
  syntax,'' as used in the last example, is completely equivalent.

<p>
<div class="versionnote"><b>Deprecated since release 2.3.</b>
Use the extended call syntax instead, as described
                   above.</div><p></p>
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-88' xml:id='l2h-88' class="function">buffer</tt></b>(</nobr></td>
  <td><var>object</var><big>[</big><var>, offset</var><big>[</big><var>, size</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
  The <var>object</var> argument must be an object that supports the buffer
  call interface (such as strings, arrays, and buffers).  A new buffer
  object will be created which references the <var>object</var> argument.
  The buffer object will be a slice from the beginning of <var>object</var>
  (or from the specified <var>offset</var>). The slice will extend to the
  end of <var>object</var> (or will have a length given by the <var>size</var>
  argument).
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-89' xml:id='l2h-89' class="function">coerce</tt></b>(</nobr></td>
  <td><var>x, y</var>)</td></tr></table></dt>
<dd>
  Return a tuple consisting of the two numeric arguments converted to
  a common type, using the same rules as used by arithmetic
  operations. If coercion is not possible, raise <tt class="exception">TypeError</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-90' xml:id='l2h-90' class="function">intern</tt></b>(</nobr></td>
  <td><var>string</var>)</td></tr></table></dt>
<dd>
  Enter <var>string</var> in the table of ``interned'' strings and return
  the interned string - which is <var>string</var> itself or a copy.
  Interning strings is useful to gain a little performance on
  dictionary lookup - if the keys in a dictionary are interned, and
  the lookup key is interned, the key comparisons (after hashing) can
  be done by a pointer compare instead of a string compare.  Normally,
  the names used in Python programs are automatically interned, and
  the dictionaries used to hold module, class or instance attributes
  have interned keys.  
<span class="versionnote">Changed in version 2.3:
Interned strings are not
  immortal (like they used to be in Python 2.2 and before);
  you must keep a reference to the return value of <tt class="function">intern()</tt>
  around to benefit from it.</span>

</dl>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.1 built-in Functions"
  href="built-in-funcs.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="2. built-in Objects"
  href="builtin.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="2.3 built-in Exceptions"
  href="module-exceptions.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="built-in-funcs.html">2.1 Built-in Functions</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="builtin.html">2. Built-in Objects</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-exceptions.html">2.3 Built-in Exceptions</a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
